package com.itheima.springboot;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class SpringbootApplication {

    public static void main(String[] args) {
        //启动SpringbootApplication返回IOC容器对象
        ConfigurableApplicationContext context = SpringApplication.run(SpringbootApplication.class, args);

      /*
        //获取IOC上下文中的外部资源
        Object redisTemplate = context.getBean("redisTemplate");
        //有则打印没有就报错
        System.out.println(redisTemplate);*/
        //获取user的bean
        Object user = context.getBean("user");
        System.out.println(user);

    }

}
